package com.oig.oauth.api.factory;

import com.oig.oauth.api.OauthService;
import com.oig.oauth.api.fallback.OauthServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OauthFallbackFactory implements FallbackFactory<OauthService> {

    @Override
    public OauthService create(Throwable cause) {
        OauthServiceFallbackImpl oauthService = new OauthServiceFallbackImpl();
        oauthService.setCause(cause);
        return oauthService;
    }

}
